<?php
/**
 * OnlyOnce.php
 * 
 * @category   Naneau
 * @package    Naneau_Action_Helper
 * @copyright  Copyright (c) 2007 Maurice Fonk - http://naneau.nl
 * @version    0.1
 * @todo find out what on earth I was planning to do with this
 */

require_once 'Zend/Controller/Action/Helper/Abstract.php';

/**
 * Naneau_Action_Helper_OnlyOnce
 * 
 * do stuff... once!
 *
 * @category   Naneau
 * @package    Naneau_Action_Helper
 * @copyright  Copyright (c) 2007 Maurice Fonk - http://naneau.nl
 */
class Naneau_Action_Helper_OnlyOnce  extends Zend_Controller_Action_Helper_Abstract {
    /**
     * keep track of state... (not exactly beautiful)
     *
     * @var bool
     */
    private static $done = false;
    
    /**
     * predispatch hook
     */
    public function preDispatch() {
        if (!self::$done) {
            //do stuff
            
            self::$done = true;
        }
    }
}